#!/bin/bash

website=smartconn.cc
author=tosone
application=parsing

[[ -d release ]] && rm -rf release
[[ -d release_story ]] && rm -rf release_story

if [[ -z ${GOPATH+x} ]]; then
  echo "Please configuration golang environment."
else
  currReleaseDir=$GOPATH/src/$website/$author/$application
  [[ -d $currReleaseDir ]] && rm -rf $currReleaseDir
  mkdir -p $currReleaseDir
  cp -r check config handler lib model parsing $currReleaseDir

  mkdir -p release/home/root
  for story in $(cat release_story.txt)
  do
    cp -r example/$story release/home/root
  done
fi
